﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GalaSoft.MvvmLight;
using Practice___下拉框绑定.Model;

namespace Practice___下拉框绑定.ViewModel
{
    public class ComboboxViewModel: ViewModelBase
    {
        public ComboboxViewModel()
        {
            complexList = new List<ComplexModel>()
            {
                new ComplexModel(){Key = 1, Text = "Winform"},
                new ComplexModel(){Key = 2, Text = "WPF"},
                new ComplexModel(){Key = 3, Text = "Xamarin"},
                new ComplexModel(){Key = 4, Text = "Asp.Net"}
            };
        }

		private ComplexModel complex;

		public ComplexModel Complex
		{
			get { return complex; }
            set
            {
                complex = value;
                RaisePropertyChanged(nameof(Complex));
            }
		}

		private List<ComplexModel> complexList;

		public List<ComplexModel> ComplexList
		{
			get { return complexList; }
            set
            {
                complexList = value;
                RaisePropertyChanged(nameof(ComplexList));
            }
		}
    }
}
